package com.ibm.epss.android;

import android.app.Activity;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.Service;
import android.content.Intent;
import android.telephony.TelephonyManager;
import android.widget.TextView;

import java.util.ArrayList;

public class ActivityProfile {

    public String userID = "catchy";
    public String userPWD = "catchy";
    private String storeFile = new String("/data/config.mqtt");

    public String TCPAddress = new String("tcp://9.119.150.41:1883");
    public String clientId = "91902";

    public String topicString = "QWERT";
    public int connTimeout = 10;
    public String publication = "Message from device";
    public boolean cleanSession = false;
    public int QoS = 2;

    // Below are global var used by this program
    public String log = "";
    public Intent intent;
    public Service ctxService;
    public Activity ctxActivity;
    public NotificationManager notiMgr;
    public Notification notification;
    public int notificationID = 19850626;
    public ArrayList<String> receivedMsgs = new ArrayList<String>();
    public TextView tvMsg;

    private static final ActivityProfile INSTANCE = new ActivityProfile();

    private ActivityProfile() {
    }

    public static final ActivityProfile getInstance() {
        return ActivityProfile.INSTANCE;
    }

    public void loadActitityProfile(TelephonyManager tm) {
        // Get Device info & display on Client ID edit view ad default
        if (tm.getDeviceId() != null) {
            setClientId(tm.getDeviceId());
        }
    }

    public String getUserID() {
        return userID;
    }

    public void setUserID(String userID) {
        this.userID = userID;
    }

    public String getUserPWD() {
        return userPWD;
    }

    public void setUserPWD(String userPWD) {
        this.userPWD = userPWD;
    }

    public String getTCPAddress() {
        return TCPAddress;
    }

    public void setTCPAddress(String TCPAddress) {
        this.TCPAddress = TCPAddress;
    }

    public String getClientId() {
        return clientId;
    }

    public void setClientId(String clientId) {
        this.clientId = clientId;
    }

    public String getTopicString() {
        return topicString;
    }

    public void setTopicString(String topicString) {
        this.topicString = topicString;
    }

    public int getConnTimeout() {
        return connTimeout;
    }

    public void setConnTimeout(int connTimeout) {
        this.connTimeout = connTimeout;
    }

    public String getPublication() {
        return publication;
    }

    public void setPublication(String publication) {
        this.publication = publication;
    }

    public boolean isCleanSession() {
        return cleanSession;
    }

    public void setCleanSession(boolean cleanSession) {
        this.cleanSession = cleanSession;
    }

    public int getQoS() {
        return QoS;
    }

    public void setQoS(int qoS) {
        QoS = qoS;
    }

    public String getLog() {
        return log;
    }

    public void setLog(String log) {
        this.log = log;
    }

    public Intent getIntent() {
        return intent;
    }

    public void setIntent(Intent intent) {
        this.intent = intent;
    }

    public Service getCtxService() {
        return ctxService;
    }

    public void setCtxService(Service ctxService) {
        this.ctxService = ctxService;
    }

    public Activity getCtxActivity() {
        return ctxActivity;
    }

    public void setCtxActivity(Activity ctxActivity) {
        this.ctxActivity = ctxActivity;
    }

    public NotificationManager getNotiMgr() {
        return notiMgr;
    }

    public void setNotiMgr(NotificationManager notiMgr) {
        this.notiMgr = notiMgr;
    }

    public Notification getNotification() {
        return notification;
    }

    public void setNotification(Notification notification) {
        this.notification = notification;
    }

    public int getNotificationID() {
        return notificationID;
    }

    public void setNotificationID(int notificationID) {
        this.notificationID = notificationID;
    }

    public ArrayList<String> getReceivedMsgs() {
        return receivedMsgs;
    }

    public void setReceivedMsgs(ArrayList<String> receivedMsgs) {
        this.receivedMsgs = receivedMsgs;
    }

    public TextView getTvMsg() {
        return tvMsg;
    }

    public void setTvMsg(TextView tvMsg) {
        this.tvMsg = tvMsg;
    }
}